package cn.nju.zyy.service;

import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Component;

import cn.nju.zyy.domain.Community;
import cn.nju.zyy.domain.Country;
import cn.nju.zyy.domain.User;

@Component
public class UserServiceImpl implements UserService {

	@Override
	public void add(User user) {
		// Persist the user object here.
		System.out.println("User added successfully.");
	}

	@Override
	public List<Country> getAllCountries() {
		List<Country> countryList = new ArrayList<Country>();
		countryList.add(new Country(1, "India"));
		countryList.add(new Country(2, "USA"));
		countryList.add(new Country(3, "UK"));
		return countryList;
	}

	@Override
	public List<Community> getAllCommunities() {
		List<Community> communityList = new ArrayList<Community>();
		communityList.add(new Community("Spring", "Spring"));
		communityList.add(new Community("Hibernate", "Hibernate"));
		communityList.add(new Community("Struts", "Struts"));
		return communityList;
	}

}
